#ifndef AGT_MATH_H
#define AGT_MATH_H

namespace agtk {
	/** Collection of math functions.
		@author Tom Savage
	**/
	
	// 3D Vector spscific functions.
	
	/** Generic function for calculating the cross-product of two generic vectors. **/
	template <class type> Vec3<type> Vec3Cross(Vec3<type> arg1, Vec3<type> arg2) {
		return Vec3<type>(arg1.Get(1)*arg2.Get(2) - arg1.Get(2)*arg2.Get(1),
			arg1.Get(2)*arg2.Get(0) - arg1.Get(0)*arg2.Get(2),
			arg1.Get(0)*arg2.Get(1) - arg1.Get(1)*arg2.Get(0));
	}
	template <class type> Vec3<type>* Vec3Cross(Vec3<type>* arg1, Vec3<type>* arg2) {
		return new Vec3<type>(arg1->Get(1)*arg2->Get(2) - arg1->Get(2)*arg2->Get(1),
			arg1->Get(2)*arg2->Get(0) - arg1->Get(0)*arg2->Get(2),
			arg1->Get(0)*arg2->Get(1) - arg1->Get(1)*arg2->Get(0));
	}
	
	/** Generic function for calculating the dot-product of two generic vectors. **/
	template <class type> type Vec3Dot(Vec3<type> arg1, Vec3<type> arg2) {
		return (arg1.Get(0)*arg2.Get(0) + arg1.Get(1)*arg2.Get(1) + arg1.Get(2)*arg2.Get(2));
	}
	template <class type> type Vec3Dot(Vec3<type>* arg1, Vec3<type>* arg2) {
		return (arg1->Get(0)*arg2->Get(0) + arg1->Get(1)*arg2->Get(1) + arg1->Get(2)*arg2->Get(2));
	}
}

#endif